<?php

@include_once('./database.php');


$uname = $_POST['user'];

$obj = [];



$sql = "select * from user where user_name = '$uname'";

$res = mysqli_query($connect, $sql);

$arr = mysqli_fetch_array($res);

$data = [];

if ($arr) {
    $data['id'] = $arr['user_id'];
    $data['name'] = $arr['user_name'];
    $data['phonenumber'] = $arr['user_phonenumber'];
    $data['password'] = $arr['user_password'];

    $obj['status'] = true;
    $obj['msg'] = '数据请求成功';
    $obj['data'] = $data;
} else {
    $obj['status'] = false;
    $obj['msg'] = '服务器错误';
}

echo (json_encode($obj, JSON_UNESCAPED_UNICODE));
